package org.example.chapter8.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.List;

/**
 * @author CoderXshuai
 * @date 2020/8/4/0004 20:58
 */
//标识为MongoDB文档
@Document(collection = "user")
public class User implements Serializable {
    private static final long serialVersionUID = 4403175817107952988L;

    //MongoDB文档编号,主键
    @Id
    private String id;
    //在MongoDB中使用user_name保存属性
    @Field("user_name")
    private String userName;
    private String note;
    //角色列表
    private List<Role> roles;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }
}
